//
//  WPRightManageInvalidCell.m
//  ZhongChouPingTai
//
//  Created by WeiPan on 16/4/8.
//  Copyright © 2016年 WPJoe. All rights reserved.
//

#import "WPRightManageInvalidCell.h"

@interface WPRightManageInvalidCell ()
@property (nonatomic, strong) UIView * grayView;/**< 灰色背景图 */
@property (nonatomic, strong) UILabel * positionLabel;/**< 位置 */
@property (nonatomic, strong) UILabel * priceLabel;/**< 价格 */
@property (nonatomic, strong) UILabel * statusLabel;/**< 状态信息 */
@property (nonatomic, strong) UILabel * transPriceLabel;/**< 转让价格 */
- (void)initializeAppearance;/**< 一般界面初始化 */
@end
@implementation WPRightManageInvalidCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initializeAppearance];
    }
    return self;
}
#pragma mark - init
- (void)initializeAppearance {
    [self addSubview:self.grayView];
    [self addSubview:self.positionLabel];
    [self addSubview:self.priceLabel];
    [self addSubview:self.statusLabel];
    [self addSubview:self.transPriceLabel];
}
- (void)setModel:(WPRightManageDetailModel *)model {
    _model = model;
    _positionLabel.text = _model.ticketPosition;
    _priceLabel.text = [NSString stringWithFormat:@"%@", _model.price];
    _transPriceLabel.text = [NSString stringWithFormat:@"%@", _model.reachPrice];
}
#pragma mark - responds events
- (void)respondsToEditBtn:(UIButton *)sender {
}
#pragma mark - getter
- (UIView *)grayView {
    if (!_grayView) {
        _grayView = ({
            UIView * view = [[UIView alloc]initWithFrame:CGRectMake(5*DHFlexibleHorizontalMutiplier(), 0, 290*DHFlexibleHorizontalMutiplier(), 30*DHFlexibleHorizontalMutiplier())];
            view.backgroundColor = COLOR_RGB(241, 241, 241, 1);
            view;
        });
    }
    return _grayView;
}
- (UILabel *)positionLabel {
    if (!_positionLabel) {
        _positionLabel = ({
            UILabel * lab = [[UILabel alloc]initWithFrame:CGRectMake(15*DHFlexibleHorizontalMutiplier(), 0, 70*DHFlexibleHorizontalMutiplier(), 30*DHFlexibleHorizontalMutiplier())];
            lab.font = [UIFont systemFontOfSize:14*DHFlexibleHorizontalMutiplier()];
            lab.textAlignment = NSTextAlignmentCenter;
            lab;
        });
    }
    return _positionLabel;
}
- (UILabel *)priceLabel {
    if (!_priceLabel) {
        _priceLabel = ({
            UILabel * lab = [[UILabel alloc]initWithFrame:CGRectMake(85*DHFlexibleHorizontalMutiplier(), 0, 70*DHFlexibleHorizontalMutiplier(), 30*DHFlexibleHorizontalMutiplier())];
            lab.font = [UIFont systemFontOfSize:12*DHFlexibleHorizontalMutiplier()];
            lab.textAlignment = NSTextAlignmentCenter;
            lab;
            
        });
    }
    return _priceLabel;
}
- (UILabel *)statusLabel {
    if (!_statusLabel) {
        _statusLabel = ({
            UILabel * lab = [[UILabel alloc]initWithFrame:CGRectMake(155*DHFlexibleHorizontalMutiplier(), 0, 70*DHFlexibleHorizontalMutiplier(), 30*DHFlexibleHorizontalMutiplier())];
            lab.font = [UIFont systemFontOfSize:12*DHFlexibleHorizontalMutiplier()];
            lab.textAlignment = NSTextAlignmentCenter;
            lab.text = @"已转让";
            lab;
        });
    }
    return _statusLabel;
}
- (UILabel *)transPriceLabel {
    if (!_transPriceLabel) {
        _transPriceLabel = ({
            UILabel * lab = [[UILabel alloc]initWithFrame:CGRectMake(225*DHFlexibleHorizontalMutiplier(), 0, 70*DHFlexibleHorizontalMutiplier(), 30*DHFlexibleHorizontalMutiplier())];
            lab.font = [UIFont systemFontOfSize:12*DHFlexibleHorizontalMutiplier()];
            lab.textAlignment = NSTextAlignmentCenter;
            lab;
        });
    }
    return _transPriceLabel;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
